package com.yxq.mdt.app.modules.spikeorder.ui.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yxq.mdt.app.R;
import com.yxq.mdt.app.glide.GlideHelper;
import com.yxq.mdt.app.modules.spikeorder.bean.OrderListBean;

import java.util.List;

/**
 * @author L
 * @time 2019-10-21
 * @describe 订单列表售后购买的商品列表
 */
public class SpikeOrderAfterSaleListGoodsListAdapter extends BaseQuickAdapter<OrderListBean.ListBean.GoodsListBean, BaseViewHolder> {

    public SpikeOrderAfterSaleListGoodsListAdapter(int layoutResId, @Nullable List<OrderListBean.ListBean.GoodsListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, OrderListBean.ListBean.GoodsListBean item) {

        GlideHelper.setLoadRoundImage(mContext, item.getGoods_pic(), 0, helper.getView(R.id.order_confirm_goods_list_iv_img));
        helper.setText(R.id.cart_tv_price, String.format("￥%.2f", item.getPrice()));
        helper.setText(R.id.tv_num, String.format("%d", item.getNum()));
        helper.setText(R.id.cart_tv_name, item.getGoods_name());
    }
}
